<?php

namespace common\models\db\tables;

use Yii;

/**
 * This is the model class for table "{{%admin_role_power}}".
 *
 * @property int $id
 * @property int $admin_role_id
 * @property int $admin_power_id
 * @property int $data_rule 数据规则 1所有 2自身 3非自身
 */
class AdminRolePower extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%admin_role_power}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['admin_role_id', 'admin_power_id', 'data_rule'], 'trim'],
            [['admin_role_id', 'admin_power_id'], 'required'],
            [['admin_role_id', 'admin_power_id', 'data_rule'], 'integer'],
            [['data_rule'], 'default', 'value' => 1],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'admin_role_id' => Yii::t('app', 'Admin Role ID'),
            'admin_power_id' => Yii::t('app', 'Admin Power ID'),
            'data_rule' => Yii::t('app', '数据规则 1所有 2自身 3非自身'),
        ];
    }
}
